package com.first.nell.data

import com.first.nell.enums.InfoPageActionEnum

data class RevObjInfoPageFieldConfig(
    var title: String? = "",
    var hint: String? = "",
    var paramName: String? = "",
    var paramNameState: String? = "",
    var paramNameCity: String? = "",
    var paramNameArea: String? = "",
    var paramNameBankName: String? = "",
    var paramNameBankCode: String? = "",
    var isMust: String? = "YES",
    var action: String? = "",
    var values: List<DataInfoPageActionValue>? = mutableListOf(),

    //为了联系人新增
    var index: Int? = 1,
    var subDataList: MutableList<RevObjInfoPageFieldConfig>? = null,
    var fillContent: String? = "",
    var needCheckComplete: Boolean? = false
) {
    fun isFirstNellActionFirstNellSelect(): Boolean {
        return action.equals(
            InfoPageActionEnum.SELECT.name,
            true
        )
    }

    fun isFirstNellActionFirstNellAddressFirstNellPick(): Boolean {
        return action.equals(
            InfoPageActionEnum.ADDRESS_PICK.name,
            true
        )
    }

    fun isFirstNellActionFirstNellAddressFirstNellStateFirstNellPick(): Boolean {
        return action.equals(
            InfoPageActionEnum.ADDRESS_STATE_PICK.name,
            true
        )
    }

    fun isFirstNellActionFirstNellAddressFirstNellCityFirstNellPick(): Boolean {
        return action.equals(
            InfoPageActionEnum.ADDRESS_CITY_PICK.name,
            true
        )
    }

    fun isFirstNellActionFirstNellAddressFirstNellAreaFirstNellPick(): Boolean {
        return action.equals(
            InfoPageActionEnum.ADDRESS_AREA_PICK.name,
            true
        )
    }

    fun isFirstNellActionFirstNellDateFirstNellPick(): Boolean {
        return action.equals(
            InfoPageActionEnum.DATE_PICK.name,
            true
        )
    }

    fun isFirstNellActionFirstNellContactFirstNellGroup(): Boolean {
        return action.equals(
            InfoPageActionEnum.CONTACT_GROUP.name,
            true
        )
    }

    fun isFirstNellActionFirstNellContactFirstNellGroupFirstNellRelation(): Boolean {
        return action.equals(
            InfoPageActionEnum.CONTACT_GROUP_RELATION.name,
            true
        )
    }

    fun isFirstNellActionFirstNellContactFirstNellGroupFirstNellName(): Boolean {
        return action.equals(
            InfoPageActionEnum.CONTACT_GROUP_NAME.name,
            true
        )
    }

    fun isFirstNellActionFirstNellContactFirstNellGroupFirstNellPhone(): Boolean {
        return action.equals(
            InfoPageActionEnum.CONTACT_GROUP_PHONE.name,
            true
        )
    }

    fun isFirstNellActionFirstNellBankFirstNellPick(): Boolean {
        return action.equals(
            InfoPageActionEnum.BANK_PICK.name,
            true
        )
    }

    fun isFirstNellActionFirstNellBankFirstNellCode(): Boolean {
        return paramName.equals(
            "bankCode",
            true
        )
    }

    fun isFirstNellActionFirstNellWalletFirstNellGroupFirstNellMobile(): Boolean {
        return paramName.equals(
            "walletMobile",
            true
        )
    }

    fun isFirstNellActionFirstNellWalletFirstNellGroupFirstNellUserFirstNellName(): Boolean {
        return paramName.equals(
            "walletUsername",
            true
        )
    }

    fun isFirstNellActionFirstNellWalletFirstNellGroupFirstNellChannel(): Boolean {
        return paramName.equals(
            "walletChannel",
            true
        )
    }

    fun isFirstNellCompleted(): Boolean {
        if (isMust?.equals("YES", true) == true) {
            return (fillContent?.isNotBlank() == true)
        } else {
            return true
        }
    }

    fun isFirstNellMustFirstNellFill(): Boolean {
        return (isMust?.equals("YES", true) == true)
    }

    fun copyFirstNellSelf(): RevObjInfoPageFieldConfig {
        return RevObjInfoPageFieldConfig(
            title = this.title,
            hint = this.hint,
            paramName = this.paramName,
            paramNameState = this.paramNameState,
            paramNameCity = this.paramNameCity,
            paramNameArea = this.paramNameArea,
            paramNameBankName = this.paramNameBankName,
            paramNameBankCode = this.paramNameBankCode,
            isMust = this.isMust,
            action = this.action,
            values = this.values,
            index = this.index,
            subDataList = this.subDataList,
            fillContent = this.fillContent,
            needCheckComplete = this.needCheckComplete
        )
    }
}